package com.lemurian.bankdata.lite.logger;

import java.util.Hashtable;

import org.apache.log4j.Logger;
import org.apache.log4j.spi.LoggerFactory;

public class BankDataCustomerLogFactory implements LoggerFactory {
	private static Hashtable<String, BankDataLogger> loggers = new Hashtable<String, BankDataLogger>();

    public Logger makeNewLoggerInstance(String name) {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(BankDataLogger.class.getClassLoader());//wherethe class returned is one from your plugin.
        BankDataLogger result = loggers.get(name);
        if (result == null) {
            result = new BankDataLogger(name, null);
        }
        Thread.currentThread().setContextClassLoader(cl);//set classloader back
        return result;
    }
}
